package main

import (
	_ "git.oschina.net/fanbuchi/timemaker/db"
	_ "git.oschina.net/fanbuchi/timemaker/docs"
	_ "git.oschina.net/fanbuchi/timemaker/routers"
	"git.oschina.net/fanbuchi/timemaker/tiedotdb"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	"github.com/satori/go.uuid"
	"runtime"
	"github.com/Unknwon/log"
)

func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
}

func main() {
	orm.Debug = true

	v := uuid.NewV4()

	//tiedotdb.CreateTable("user")
	_, error := tiedotdb.Insert("user", map[string]interface{}{
		"uid":  v.String(),
		"name": "zhangsan"})
	if error != nil {

	}
	log.Debug("ddd",beego.AppPath)
	imgdic := beego.AppConfig.String("imgdic")
	beego.SetStaticPath(imgdic, "img")
	if beego.RunMode == "dev" {
		beego.DirectoryIndex = true
		beego.StaticDir["/swagger"] = "swagger"
	}
	beego.Run()
}
